package com.hezhiqin.springbootfirst;

import com.hezhiqin.springbootfirst.firstdemo.Demo;
import hezhiqin.com.autoconfigtation.HelloFormatTemplate;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * @program: homeWork
 * @description:
 * @author: hezhiqin
 * @create: 2020-01-13 14:18
 */
@RestController
public class HelloController{

    @Autowired
    Demo demo;

    @Autowired
    HelloFormatTemplate helloFormatTemplate;


    @GetMapping("/hello")
    public String hello (HttpServletRequest httpRequest){

        HashMap<String,String> map = new HashMap<String,String>();
        map.put("hehe","hezhiqin");
        return helloFormatTemplate.doFormat(map);
    }
}
